package entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the resolutions database table.
 * 
 */
@Embeddable
public class ResolutionPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private double width;

	private double height;

    public ResolutionPK() {
    }
	public double getWidth() {
		return this.width;
	}
	public void setWidth(double width) {
		this.width = width;
	}
	public double getHeight() {
		return this.height;
	}
	public void setHeight(double height) {
		this.height = height;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ResolutionPK)) {
			return false;
		}
		ResolutionPK castOther = (ResolutionPK)other;
		return 
			(this.width == castOther.width)
			&& (this.height == castOther.height);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (java.lang.Double.doubleToLongBits(this.width) ^ (java.lang.Double.doubleToLongBits(this.width) >>> 32)));
		hash = hash * prime + ((int) (java.lang.Double.doubleToLongBits(this.height) ^ (java.lang.Double.doubleToLongBits(this.height) >>> 32)));
		
		return hash;
    }
}